//
//  LoginHandler.m
//  NetMobileLocation
//
//  Created by Mehmet Sinan Şahin on 3/10/12.
//  Copyright (c) 2012 netgis. All rights reserved.
//

#import "LoginHandler.h"
#import "LoginRequest.h"
#import "SharedPrefs.h"
#import "NSString+Extensions.h"

@implementation LoginHandler

@synthesize request;

- (id)init: (LoginRequest *)pRequest {
    self = [super init];
    if (self) {
        self.request = [pRequest retain];
    }
    return self;
}


- (void) loginHandler: (id) value {
    NSLog(@"--->%@", value);
    if ([NSString isEmpty:value]) {
        //TODO kullanıcı adı, parola yanlış, kullanıcıya bunu göster     
    } else {
        [SharedPrefs setSessionID:value];
        [SharedPrefs setUserName: request.userName];
        [SharedPrefs setPassword: request.password];
    }   
}

-(void) dealloc {
    [request release];
    [super dealloc];
}



@end
